package com.soft.collateral.entity;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 合同表
 * </p>
 *
 * @author liubin
 * @since 2025-07-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("contracts")
@ApiModel(value="Contracts对象", description="合同表")
public class Contracts implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "合同id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "合同编号")
    @TableField("contract_number")
    private String contractNumber;

    @ApiModelProperty(value = "押品编号")
    @TableField("collateral_id")
    private String collateralId;

    @ApiModelProperty(value = "卖出方")
    @TableField("seller")
    private String seller;

    @ApiModelProperty(value = "买入方")
    @TableField("buyers")
    private String buyers;

    @ApiModelProperty(value = "合同类型")
    @TableField("contracts_type")
    private Integer contractsType;

    @ApiModelProperty(value = "交易内容")
    @TableField("contracts_content")
    private String contractsContent;

    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "Asia/Shanghai")
    @ApiModelProperty(value = "生效日期")
    @TableField("Effective_date")
    private LocalDate effectiveDate;

    @ApiModelProperty(value = "交易金额")
    @TableField("amount")
    private Double amount;

    @ApiModelProperty(value = "付款方式")
    @TableField("payment_method")
    private Integer paymentMethod;

    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "Asia/Shanghai")
    @ApiModelProperty(value = "签订时间")
    @TableField("Signing_date")
    private LocalDate signingDate;

    @ApiModelProperty(value = "合同图片")
    @TableField("contracts_pdf")
    private String contractsPdf;

}
